<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">


<ui:composition template="/template.xhtml">
	<ui:define name="tituloPagina">
		<p:outputLabel value="Painel Quantitativo de Compromissos" />
	</ui:define>
	<ui:define name="botoes">
		<div>
			<p:panelGrid columns="2"
				style="
				margin-left: 184px;margin-top: -8px;">
				<p:outputLabel value="Data Inicio:"></p:outputLabel>
				<p:inputMask value="#{compromissoBean.periodoMascaraFiltroInicio}"
					mask="99/9999" />


				<p:outputLabel value="Data Final:"></p:outputLabel>

				<p:inputMask value="#{compromissoBean.periodoMascaraFiltroFim}"
					mask="99/9999" />
			</p:panelGrid>
			<p:panelGrid columns="3" style="margin-left: 70px;">

				<p:outputLabel value="Filtrar Por:"></p:outputLabel>
				<p:selectOneMenu style="width: 226px; " required="false"
					value="#{compromissoBean.filtroRelatorio}">
					<f:selectItem itemLabel="Selecione" itemValue=""></f:selectItem>
					<f:selectItem itemLabel="Todos" itemValue="Todos"></f:selectItem>
					<f:selectItem itemLabel="Diretoria" itemValue="Diretoria">
					</f:selectItem>
					<f:selectItem itemLabel="Gerencia" itemValue="Gerencia"></f:selectItem>
					<f:selectItem itemLabel="Pessoa" itemValue="Pessoa"></f:selectItem>
					<f:selectItem itemLabel="Reunião" itemValue="Reuniao"></f:selectItem>

				</p:selectOneMenu>
				<p:commandButton icon="ui-icon-document"
					action="#{compromissoBean.verificaFiltroRelatorioQualitativo()}"
					style=" height:33px;" ajax="false"
					title="Selecione">
				</p:commandButton>
			</p:panelGrid>
		</div>


	</ui:define>
	<ui:define name="principal">

		<style>
.ui-datepicker {
	font-size: 80% !important;
}
</style>


		<script type="text/javascript" language="javascript">
			PrimeFaces.locales['pt_BR'] = {
				closeText : 'Fechar',
				prevText : 'Anterior',
				nextText : 'Próximo',
				currentText : 'Começo',
				monthNames : [ 'Janeiro', 'Fevereiro', 'Março', 'Abril',
						'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro',
						'Outubro', 'Novembro', 'Dezembro' ],
				monthNamesShort : [ 'Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun',
						'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez' ],
				dayNames : [ 'Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta',
						'Sexta', 'Sábado' ],
				dayNamesShort : [ 'Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex',
						'Sáb' ],
				dayNamesMin : [ 'D', 'S', 'T', 'Q', 'Q', 'S', 'S' ],
				weekHeader : 'Semana',
				firstDay : 0,
				isRTL : false,
				showMonthAfterYear : false,
				yearSuffix : '',
				timeOnlyTitle : 'Só Horas',
				timeText : 'Tempo',
				hourText : 'Hora',
				minuteText : 'Minuto',
				secondText : 'Segundo',
				ampm : false,
				month : 'Mês',
				week : 'Semana',
				day : 'Dia',
				allDayText : 'Todo o Dia'
			};
		</script>


		<p:selectOneMenu value="#{compromissoBean.diretoriaRelatorio}"
			style="width: 229px;
				margin-left: 740px; margin-bottom : -7px;"
			id="diretoria"
			rendered="#{compromissoBean.validacaoRelatorioDiretoria}">
			<f:selectItem itemLabel="Selecione" itemValue=""></f:selectItem>
			<f:selectItems value="#{compromissoBean.listaDiretoriaRelatorio}"></f:selectItems>

		</p:selectOneMenu>

		<p:selectOneMenu value="#{compromissoBean.reuniaoRelatorio}"
			style="width: 229px;
				margin-left: 740px; margin-bottom : -7px;"
			id="reuniao" rendered="#{compromissoBean.validacaoRelatorioReuniao}">
			<f:selectItem itemLabel="Selecione" itemValue=""></f:selectItem>
			<f:selectItems value="#{compromissoBean.listaReuniaoRelatorio}"></f:selectItems>

		</p:selectOneMenu>



		<p:selectOneMenu value="#{compromissoBean.gerenciaRelatorio}"
			style="width: 229px;
				margin-left: 740px; margin-bottom : -7px;"
			rendered="#{compromissoBean.validacaoRelatorioGerencia}">
			<f:selectItem itemLabel="#{msgs['campos.combobox.selecione']}"
				itemValue=""></f:selectItem>
			<f:selectItems value="#{compromissoBean.listaGerenciaRelatorio}"></f:selectItems>

		</p:selectOneMenu>

		<p:selectOneMenu value="#{compromissoBean.pessoaRelatorio}"
			style="width: 229px;
				margin-left: 740px; margin-bottom : -7px;"
			rendered="#{compromissoBean.validacaoRelatorioPessoa}">
			<f:selectItem itemLabel="#{msgs['campos.combobox.selecione']}"
				itemValue=""></f:selectItem>
			<f:selectItems value="#{compromissoBean.listaPessoaRelatorio}"></f:selectItems>

		</p:selectOneMenu>



		<p:commandButton icon="ui-icon-search"
			style=" height:33px; width: 42px;  margin-left: 9px; margin-bottom : 20px;"
			rendered="#{compromissoBean.bottomGerarRelatorio}"
			action="#{compromissoBean.populaGrafico()}" ajax="false"
			title="Pesquisar"></p:commandButton>

		<p:outputLabel value="Nenhum dado encontrado" style="color:red" rendered="#{compromissoBean.haDadosNoPainelQuantitativo}"/>
		
		<p:pieChart id="sample" value= "#{compromissoBean.pieModel}" 
			legendPosition="w" style="width:100%;height:400px"
			showDataLabels="true" shadow="true"
			seriesColors="8FBC8F,CD5555,7EC0EE"
			rendered="#{compromissoBean.mostrarRelatorio}">			
			<p:ajax event="itemSelect" listener="#{compromissoBean.itemSelect}"
				update="tb1" />


		</p:pieChart>



		<p:dialog id="basicDialog" widgetVar="dialog" resizable="false">
			<p:dataTable
				value="#{compromissoBean.compromissosDataTableRelatorio}"
				var="_lista" paginator="true" rows="20" id="tb1">

				<p:column headerText="Data da Reunião" style="widh: 50px;">
					<p:outputLabel value="#{_lista.reuniao.dataReuniao}">
						<f:convertDateTime pattern="dd/MM/yyyy hh:mm" timeZone="GMT-03:00" />
					</p:outputLabel>
				</p:column>

				<p:column headerText="Meta" style="widh: 50px;">
					<p:outputLabel value="#{_lista.metaConclusao}">
						<f:convertDateTime pattern="dd/MM/yyyy" timeZone="GMT-03:00" />

					</p:outputLabel>
				</p:column>

				<p:column headerText="Número" style="widh: 20px;">
					<p:outputLabel value="#{_lista.numeroCompromisso}" />
				</p:column>


				<p:column headerText="Status" style="widh: 70px;">
					<p:outputLabel value="#{_lista.status}" />
				</p:column>





				<p:column headerText="Responsável" style="widh: 140px;">
					<p:outputLabel value="#{_lista.pessoa.nome}" />
				</p:column>


				<p:column headerText="Solicitante" style="widh: 140px;">
					<p:outputLabel value="#{_lista.solicitante.nome}" />
				</p:column>


				<p:column headerText="Descrição">
					<p:outputLabel value="#{_lista.descricao}" />
				</p:column>


			</p:dataTable>

		</p:dialog>



	</ui:define>
</ui:composition>
</html>